<?php
class DetailController extends Controller_Helper
{
    public function indexAction()
    {
        $this->view->title = '';
        $className = get_class();
        $classType = strtolower(preg_replace('/Controller/', '', $className));
        $this->view->controller = $classType;

        $view = $this->view;
        $id = $this->_request->getParam('id', 0);
        $view->id = $id;
        //基本信息
        $view->modelType = Business_Model::getInstance()->getModelTypes();
        $modelDetail = Business_Model::getInstance()->getModelDetails($id);
        $tabeInfo = Zend_Registry::get('database')->modellist;
        if (!$modelDetail) {
            $modelDetail = array(
                $tabeInfo->id => 0,
                $tabeInfo->name => '',
                $tabeInfo->description1 => '',
            	$tabeInfo->description2 => '',
            	$tabeInfo->description3 => '',
                $tabeInfo->pictures => '',
                $tabeInfo->coverimage => '',
                $tabeInfo->type => 1,
                $tabeInfo->display => 1,
            );
        }
        if ($this->_language == 'zh') {
        	$modelDetail['description'] = $modelDetail[$tabeInfo->description1];
        } elseif ($this->_language == 'pt') {
        	$modelDetail['description'] = $modelDetail[$tabeInfo->description3];
        } else {
        	$modelDetail['description'] = $modelDetail[$tabeInfo->description2];
        }
        $view->model = $modelDetail;
        $this->_getColumnIndex();
    }
}